﻿@model List<HQPad.Models.ArmourItem>

<h2>Armour</h2>

@if (Model != null && Model.Count > 0)
{
    <ul class="armour-list">
        @foreach(var armour in Model) {
            <li class="@Html.Raw("type-" + Enum.GetName(typeof(HQPad.Helpers.ArmourType), armour.Type).ToLower()  + ((armour.Equipped) ? " equipped\"" :  ""))">
                <div class="left">
                <span class="description">@Html.Raw(armour.Description)</span>
                @if (armour.Equipped) {
                    <span>(equipped)</span>    
                }

                
                @if (!string.IsNullOrEmpty(armour.ItemName)) {
                    <br /><span class="name">@Html.Raw(armour.ItemName)</span>
                }
                
                @if (armour.Superior > 0) {
                    <br />@Html.Raw("Superior ")<span class="highlight">+@Html.Raw(armour.Superior.ToString())</span>
                }

                @if (armour.Empowered > 0) {
                    <br />@Html.Raw("Empowered ")<span class="highlight">+@Html.Raw(armour.Empowered.ToString())</span>
                }

                @if (armour.Ensorcelled > 0) {
                    <br />@Html.Raw("Ensorcelled ")<span class="highlight">+@Html.Raw(armour.Ensorcelled.ToString())</span>
                }
                </div>
                <div class="middle">
                    <p>@Html.ActionLink("edit", "EditArmour", "Character", new { id = armour.Id }, new { @class = "edit-record modal-window button", @target = "_blank", title = "Edit the details for this armour" })</p>
                    <p>@Html.ActionLink("remove", "RemoveItem", "Character", new { id = armour.Id }, new { @class = "remove-item button", title = "Discard this armour record" })</p>
                    <p>@Html.ActionLink(armour.Equipped ? "unequip" : "equip", "EquipItem", "Character", new { id = armour.Id }, new { @class = "equip-item button " + ((armour.Equipped) ? "unequip" : "equip"), data_equipped = armour.Equipped.ToString().ToLower(), title = ((armour.Equipped) ? "Unequip" : "Equip") + " this armour" })</p>
                </div>
                <div class="right">
                    @Html.Partial("~/Views/Shared/QualitySummaryList.cshtml", armour.Qualities)
                    <p class="qualitites-button">@Html.ActionLink("qualities", "EditQualities", new { id = armour.Id }, new { @class = "modal-window-custom button", @target = "_blank" })</p>
                </div>
            </li>
        }
    </ul>
}
else
{
    <p>You have no armour.</p>
}